package demon2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Text {
    public static void main(String[] args) {
        String[] strings ={"rect","cycle","rect"};
        Cycle cycle =new Cycle();
        Rect rect =new Rect();
        for (String s:strings) {
            if (s.equals("cycle")){
                cycle.print();
            }
            if (s.equals("rect")){
                rect.print();
            }
        }
    }
    public static void main1(String[] args) {
        Shape[] shapes ={new Rect(),new Cycle(),new Rect()};
        for (Shape shape:shapes) {
            shape.print();
        }
    }
}
